package com.domain.dto.permission;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
@Schema(description = "添加权限数据")
public class AddPermissionDTO {

    @NotBlank(message = "权限名称不能为空")
    @Schema(description = "权限名称", example = "XX权限")
    private String permissionName;

    @Schema(description = "权限描述", example = "这是XX权限")
    private String description;

    @NotNull(message = "父节点不能为空")
    @Schema(description = "父结点id", example = "1")
    private Integer parentId;

    @Schema(description = "显示顺序", example = "1")
    private Integer orderNum;

    @NotBlank(message = "组件路径不能为空")
    @Schema(description = "组件路径", example = "/permission/add")
    private String componentPath;

    @Schema(description = "权限路径", example = "暂无设计")
    private String path;

    @NotBlank(message = "菜单类型不能为空")
    @Pattern(regexp = "^[FMC]$", message = "菜单类型必须是'F', 'M', 或者 'C'")
    @Schema(description = "菜单类型", example = "F:按钮，C:页面，M:菜单")
    private String menuType;

    @Schema(description = "权限状态", example = "0：启用，1：禁用")
    private Integer status;

    @Schema(description = "权限标识", example = "system:permission:add")
    private String perms;

}
